package Interfaz;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;


/**
 * CU013 - Listar lugares de realización
 * @author 
 */
public class CU013 {

	protected Shell shlLugaresDeRealizacin;
	private Text text;
	private Table table;
	private Text text_1;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			CU013 window = new CU013();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		
		// Centrar ventana
		Monitor primary = display.getPrimaryMonitor();
		Rectangle bounds = primary.getBounds();
		Rectangle rect = shlLugaresDeRealizacin.getBounds();	    
		int x = bounds.x + (bounds.width - rect.width) / 2;
		int y = bounds.y + (bounds.height - rect.height) / 2;	    
		shlLugaresDeRealizacin.setLocation(x, y);
		
		shlLugaresDeRealizacin.open();
		shlLugaresDeRealizacin.layout();
		while (!shlLugaresDeRealizacin.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shlLugaresDeRealizacin = new Shell(SWT.CLOSE | SWT.TITLE | SWT.MIN);
		shlLugaresDeRealizacin.setMinimumSize(new Point(600, 400));
		shlLugaresDeRealizacin.setSize(750, 552);
		shlLugaresDeRealizacin.setText("Lugares de realizaci\u00F3n");
		
		text = new Text(shlLugaresDeRealizacin, SWT.BORDER);
		text.setBounds(78, 83, 219, 21);
		
		Label label = new Label(shlLugaresDeRealizacin, SWT.NONE);
		label.setText("Filtros:");
		label.setBounds(10, 15, 55, 15);
		
		Button btnNombre = new Button(shlLugaresDeRealizacin, SWT.CHECK);
		btnNombre.setText("Nombre:");
		btnNombre.setBounds(10, 85, 62, 16);
		
		Button btnCdigo = new Button(shlLugaresDeRealizacin, SWT.CHECK);
		btnCdigo.setText("C\u00F3digo:");
		btnCdigo.setBounds(10, 45, 57, 16);
		
		Button btnDeporte = new Button(shlLugaresDeRealizacin, SWT.CHECK);
		btnDeporte.setText("Deporte:");
		btnDeporte.setBounds(10, 125, 62, 16);
		
		Button button_4 = new Button(shlLugaresDeRealizacin, SWT.NONE);
		button_4.setText("Buscar");
		button_4.setBounds(10, 167, 108, 32);
		
		Label label_1 = new Label(shlLugaresDeRealizacin, SWT.NONE);
		label_1.setText("Resultados de la b\u00FAsqueda:");
		label_1.setBounds(10, 217, 150, 15);
		
		table = new Table(shlLugaresDeRealizacin, SWT.BORDER | SWT.FULL_SELECTION);
		table.setLinesVisible(true);
		table.setHeaderVisible(true);
		table.setBounds(10, 247, 575, 193);
		
		TableColumn tblclmnCdigo = new TableColumn(table, SWT.NONE);
		tblclmnCdigo.setWidth(190);
		tblclmnCdigo.setText("C\u00F3digo");
		
		TableColumn tblclmnNombre = new TableColumn(table, SWT.NONE);
		tblclmnNombre.setWidth(190);
		tblclmnNombre.setText("Nombre");
		
		TableColumn tblclmnDeporte = new TableColumn(table, SWT.NONE);
		tblclmnDeporte.setWidth(190);
		tblclmnDeporte.setText("Deportes");
		
		TableItem tableItem = new TableItem(table, SWT.NONE);
		tableItem.setText(new String[] {"100734", "Club Pepito", "Tenis, F\u00FAtbol, Rugby"});
		
		TableItem tableItem_1 = new TableItem(table, SWT.NONE);
		tableItem_1.setText(new String[] {"100735", "Estadio UTN", "F\u00FAtbol"});
		
		TableItem tableItem_2 = new TableItem(table, SWT.NONE);
		tableItem_2.setText(new String[] {"100736", "Club Sistemas", "Handbol, Rugby"});
		
		Button btnNuevo = new Button(shlLugaresDeRealizacin, SWT.NONE);
		btnNuevo.setText("Nuevo");
		btnNuevo.setBounds(613, 268, 108, 32);
		
		Button btnModificar = new Button(shlLugaresDeRealizacin, SWT.NONE);
		btnModificar.setText("Editar");
		btnModificar.setBounds(613, 318, 108, 32);
		
		Button button_7 = new Button(shlLugaresDeRealizacin, SWT.NONE);
		button_7.setText("Salir");
		button_7.setBounds(613, 471, 108, 32);
		
		text_1 = new Text(shlLugaresDeRealizacin, SWT.BORDER);
		text_1.setBounds(73, 43, 110, 21);
		
		Combo combo = new Combo(shlLugaresDeRealizacin, SWT.READ_ONLY);
		combo.setItems(new String[] {"B\u00E1squetbol", "F\u00FAtbol", "Handbol", "Tenis"});
		combo.setBounds(78, 123, 128, 23);
		
		Button btnEliminar = new Button(shlLugaresDeRealizacin, SWT.NONE);
		btnEliminar.setText("Eliminar");
		btnEliminar.setBounds(613, 368, 108, 32);

	}

}
